


<!-- ------------------------search------------------------>
<div class="grid_12">

    <div class="search" title="<?=$this->lang->line('advanced_search');?>">

        <form  id="filter" method="post" action="<?= $url ?>users/">
            <table>
                <tr>
                    <td><?=$this->lang->line('street');?>:</td>
                    <td>
                        <select name="streetid">
                            <option><?=$this->lang->line('select_street');?></option>
                            <?php foreach ($streets as $street): ?>
                                <option value="<?= $street['ID'] ?>" <?php if ($street['ID'] == $_POST['streetid']): ?>  selected  <?php endif; ?>><?= $street['Name'] ?></option>
                            <?php endforeach; ?>
                                </select>
                            </td>

                        </tr>

                        <tr>


                            <td><?=$this->lang->line('address');?>:</td>
                            <td>
                                <?=$this->lang->line('build');?>
                                <input type="text" size="2" name="Buildingn" value="<?= $_POST['Buildingn'] ?>">
                                <?=$this->lang->line('entrance');?>
                                <input type="text" size="2" name="Entrance" value="<?= $_POST['Entrance'] ?>">
                                <?=$this->lang->line('floor');?>
                                <input type="text" size="2" name="Floor" value="<?= $_POST['Floor'] ?>">
                                <?=$this->lang->line('aparth');?>
                                <input type="text" size="2" name="Apartn" value="<?= $_POST['Apartn'] ?>">

                            </td>
                        </tr>


                        <tr>


                            <td><?=$this->lang->line('tariff');?>:</td>
                            <td>
                                <select name="tariff">
                                    <option value=""><?=$this->lang->line('select_tariff');?></option>
                            <?php foreach ($tariffs as $tariff): ?>
                                        <option  <?php if ($tariff['name'] == $_POST['tariff']): ?>  selected  <?php endif; ?>><?= $tariff['name'] ?></option>
                            <?php endforeach; ?>
                                        </select>
                                    </td>
                                </tr>
                                <tr>

                                    <td><?=$this->lang->line('balance');?>:</td>
                                    <td>

                                        <input type="radio" <?php if ($_POST['balanceval'] == 1 || !$_POST['balanceval']): ?>  CHECKED <?php endif; ?>  name="balanceval" value="1"> <?=$this->lang->line('min');?>
                                            <input type="radio" <?php if ($_POST['balanceval'] == 2): ?>  CHECKED <?php endif; ?> name="balanceval" value="2"> <?=$this->lang->line('max');?>
                                                <input type="radio" <?php if ($_POST['balanceval'] == 3): ?>  CHECKED <?php endif; ?> name="balanceval" value="3"> <?=$this->lang->line('is');?>
                                                    <input type="text" size="2" name="balance" value="<?= $_POST['balance'] ?>">
                                                </td>
                                            </tr>
                                            <tr>

                                                <td><?=$this->lang->line('registred');?>:</td>
                                                <td>
                                                    <?=$this->lang->line('from');?>
                                                    <input type="text" id="from" name="from" value="<?= $_POST['from'] ?>"/>
                                                    <?=$this->lang->line('to');?>
                                                    <input type="text" id="to" name="to"  value="<?= $_POST['to'] ?>"/>

                                                </td>
                                            </tr>
                                            <tr>

                                                <td>Online:</td>
                                                <td>
                                                    <input type="checkbox" name="on" <?php if ($_POST['on'] == 1): ?>  CHECKED <?php endif; ?> value="1"/>
                                                    </td>
                                                </tr>

                                                <tr>

                                                    <td></td>
                                                    <td>
                                                        <input type="hidden" name="filter" value="1">
                                                        <input type="submit" OnClick="searchHash()"  value="<?=$this->lang->line('apply');?>">
                                                    </td>
                                                </tr>
                                            </table>








                                        </form>
                                    </div>


                                    <label for="search"> <?=$this->lang->line('fast_search');?>: </label> <input id="search" AUTOCOMPLETE = "off" type="text" size="70" > <input type="radio" checked  name="search" value="login"> <?=$this->lang->line('login_l');?>  <input type="radio" name="search" value="name"> <?=$this->lang->line('name_l');?><input type="radio" name="search" value="ip"> IP


                                </div>
                                <!-- ---------------------endsearch----------------------------->

                                <div class="clear"></div>
                                <div class="grid_12">




                                    <div id="controls">
                                        <div id="perpage">
                                            <select onchange="per_page((this.value))">
                                                <option value="10" <?php if ($_COOKIE['per_page'] == 10): ?> selected <?php endif; ?>>10</option>
                                                    <option value="20" <?php if ($_COOKIE['per_page'] == 20): ?> selected <?php endif; ?>>20</option>
                                                        <option value="30" <?php if ($_COOKIE['per_page'] == 30): ?> selected <?php endif; ?>>30</option>
                <?php for ($i = 50; $i < 550; $i = $i + 50): ?>
                                                                            <option value="<?= $i ?>" <?php if ($_COOKIE['per_page'] == $i): ?> selected <?php elseif (!$_COOKIE['per_page'] && $i == 100): ?> selected <?php else: ?><?php endif; ?>> <?= $i ?></option>
                <?php endfor; ?>

                                                                                    </select>
            <?= $pages ?>

                                                                                    </div>

                                                                                </div>
                                                                                <div id="test"></div>
                                                                                <div class="box">

                                                                                    <button id="sendmessage"><?=$this->lang->line('send_message');?></button>
                                                                                    
                                                                                    <div id="messagebox" title="<?=$this->lang->line('send_message');?>"></div>

                                                                                    <div class="block" id="tables">
                                                                                        <table>
                                                                                            <thead>
                                                                                                <tr>
                                                                                                    <th>№<input type="checkbox" id="maincheck"></th>
                                                                                                    <th ><?=$this->lang->line('login');?><a href="javascript::void(0)" OnClick="sort(2,'login')"><img src="<?= $url ?>img/<?php if ($_COOKIE['order'] == 2 && $_COOKIE['sort'] == 'login'): ?>descg.png<?php else: ?>desc.png<?php endif; ?>" align="right"></a><a href="javascript::void(0)" OnClick="sort(1,'login')"><img src="<?= $url ?>img/<?php if ($_COOKIE['order'] == 1 && $_COOKIE['sort'] == 'login'): ?>ascg.png<?php else: ?>asc.png<?php endif; ?>" align="right"></a></th>
                                                                                                    <th>№ Д<a href="javascript::void(0)" OnClick="sort(2,'nd')"><img src="<?= $url ?>img/<?php if ($_COOKIE['order'] == 2 && $_COOKIE['sort'] == 'nd'): ?>descg.png<?php else: ?>desc.png<?php endif; ?>" align="right"></a><a href="javascript::void(0)" OnClick="sort(1,'nd')"><img src="<?= $url ?>img/<?php if ($_COOKIE['order'] == 1 && $_COOKIE['sort'] == 'nd'): ?>ascg.png<?php else: ?>asc.png<?php endif; ?>" align="right"></a></th>
                                                                                                    <th>IP<a href="javascript::void(0)" OnClick="sort(2,'ip')"><img src="<?= $url ?>img/<?php if ($_COOKIE['order'] == 2 && $_COOKIE['sort'] == 'ip'): ?>descg.png<?php else: ?>desc.png<?php endif; ?>" align="right"></a><a href="javascript::void(0)" OnClick="sort(1,'ip')"><img src="<?= $url ?>img/<?php if ($_COOKIE['order'] == 1 && $_COOKIE['sort'] == 'ip'): ?>ascg.png<?php else: ?>asc.png<?php endif; ?>" align="right"></a></th>
                                                                                                    <th><?=$this->lang->line('tariff');?></th>
                                                                                                    <th><?=$this->lang->line('fio');?><a href="javascript::void(0)" OnClick="sort(2,'name')"><img src="<?= $url ?>img/<?php if ($_COOKIE['order'] == 2 && $_COOKIE['sort'] == 'name'): ?>descg.png<?php else: ?>desc.png<?php endif; ?>" align="right"></a><a href="javascript::void(0)" OnClick="sort(1,'name')"><img src="<?= $url ?>img/<?php if ($_COOKIE['order'] == 1 && $_COOKIE['sort'] == 'name'): ?>ascg.png<?php else: ?>asc.png<?php endif; ?>" align="right"></a></th>
                                                                                                    <th><?=$this->lang->line('address');?></th>
                                                                                                    <th>Download<a href="javascript::void(0)" OnClick="sort(2,'download')"><img src="<?= $url ?>img/<?php if ($_COOKIE['order'] == 2 && $_COOKIE['sort'] == 'download'): ?>descg.png<?php else: ?>desc.png<?php endif; ?>" align="right"></a><a href="javascript::void(0)" OnClick="sort(1,'download')"><img src="<?= $url ?>img/<?php if ($_COOKIE['order'] == 1 && $_COOKIE['sort'] == 'download'): ?>ascg.png<?php else: ?>asc.png<?php endif; ?>" align="right"></a></th>
                                                                                                    <th>Upload<a href="javascript::void(0)" OnClick="sort(2,'upload')"><img src="<?= $url ?>img/<?php if ($_COOKIE['order'] == 2 && $_COOKIE['sort'] == 'upload'): ?>descg.png<?php else: ?>desc.png<?php endif; ?>" align="right"></a><a href="javascript::void(0)" OnClick="sort(1,'upload')"><img src="<?= $url ?>img/<?php if ($_COOKIE['order'] == 1 && $_COOKIE['sort'] == 'upload'): ?>ascg.png<?php else: ?>asc.png<?php endif; ?>" align="right"></a></th>
                                                                                                    <th><?=$this->lang->line('balance');?><a href="javascript::void(0)" OnClick="sort(2,'cash')"><img src="<?= $url ?>img/<?php if ($_COOKIE['order'] == 2 && $_COOKIE['sort'] == 'cash'): ?>descg.png<?php else: ?>desc.png<?php endif; ?>" align="right"></a><a href="javascript::void(0)" OnClick="sort(1,'cash')"><img src="<?= $url ?>img/<?php if ($_COOKIE['order'] == 1 && $_COOKIE['sort'] == 'cash'): ?>ascg.png<?php else: ?>asc.png<?php endif; ?>" align="right"></a></th>
                                                                                                 </tr>
                                                                                           </thead>
                                                                                           <tbody>
                                                                                           
                    <?php $i = 1;
                                                                                                                                                                                                        foreach ($users as $user): ?>



                                                                                                                                                                                                            <tr class="users">
                                                                                                                                                                                                                <td><?= $i ?><input type="checkbox" name="users[]" class="mc" value2="<?= $user['IP'] ?>" value="<?= $user['login'] ?>"></td>
                                                                                                                                                                                                                <td
<?php if ($user['Status'] == 1): ?>class="online"<?php elseif ($user['Down'] == 1 || ($user['Down'] == 1 && $user['Passive'] == 1)): ?>class="Down"<?php elseif ($user['Passive'] == 1): ?>class="Freeze"<?php else: ?>class="offline"<?php endif; ?>
                                                                                                                                                                                                                            ><a href="<?= $url ?>user/name/<?= $user['login'] ?>"><?= $user['login'] ?> </a>
<?php if ($user['AlwaysOnline'] == 1): ?><img align="right" src="<?= $url ?>img/Online.png"> <?php endif; ?>
                                                                                                                                                                                                                            </td>
                                                                                                                                                                                                                            <td>
<?php if ($user['Userdata2'] == ''): ?><?=$this->lang->line('fucker');?><?php else : ?><?= $user['Userdata2'] ?><?php endif; ?>
                                                                                                                                                                                                                                    </td>
                                                                                                                                                                                                                                    <td>
<?= $user['IP'] ?>
                                                                                                                                                                                                                                    </td>
                                                                                                                                                                                                                                    <td <?php if ($user['TariffChange']): ?>style="background-color:yellow"<?php endif; ?> align="center"><?= $user['Tariff'] ?><?php if ($user['TariffChange']): ?><?= " / " . $user['TariffChange'] ?><?php endif; ?>
                                                                                                                                                                                                                                            </td>
                                                                                                                                                                                                                                            <td>
<?= $user['RealName'] ?>
                                                                                                                                                                                                                                            </td>
                                                                                                                                                                                                                                            <td>
                            <?php if ($user['StreetName']): ?>вул. <?= $user['StreetName'] ?><?php endif; ?>
                            <?php if ($user['Buildingn']): ?> <?= $user['Buildingn'] ?><?php endif; ?>
                            <?php if ($user['Entrance']): ?>, під. <?= $user['Entrance'] ?><?php endif; ?>
                            <?php if ($user['Floor']): ?>, пов. <?= $user['Floor'] ?><?php endif; ?>
<?php if ($user['Apartn']): ?>, кв. <?= $user['Apartn'] ?><?php endif; ?>

                                                                                                                                                                                                                                                                </td>
                                                                                                                                                                                                                                                                <td align="right">
<?= $user['Download'] ?>
                                                                                                                                                                                                                                                                </td>
                                                                                                                                                                                                                                                                <td align="right">
<?= $user['Upload'] ?>
                                                                                                                                                                                                                                                                </td>
                                                                                                                                                                                                                                                                <td <?php if ($user['Cash'] < 0): ?>style="background:red;text-decoration:blink"<?php endif; ?> align="right">
                                                                                                                                                                                                                                                                        <span id="money"><?= $user['Cash'] ?></span>
                                                                                                                                                                                                                                                                    </td>
                                                                                                                                                                                                                                                                </tr>
<?php ++$i;
                                                                                                                                                                                                                                                                    endforeach; ?>
                                                                                                                                                                                                                                                                </tbody>

                                                                                                                                                                                                                                                            </table>
                                                                                                                                                                                                                                                        </div>
                                                                                                                                                                                                                                                    </div>
                                                                                                                                                                                                                                                    <div id="clear"></div>


                                                                                                                                                                                                                                                    <div id="controls">
                                                                                                                                                                                                                                                        <div id="perpage">
                                                                                                                                                                                                                                                            <select onchange="per_page((this.value))">
                                                                                                                                                                                                                                                                <option value="10" <?php if ($_COOKIE['per_page'] == 10): ?> selected <?php endif; ?>>10</option>
                                                                                                                                                                                                                                                                    <option value="20" <?php if ($_COOKIE['per_page'] == 20): ?> selected <?php endif; ?>>20</option>
                                                                                                                                                                                                                                                                        <option value="30" <?php if ($_COOKIE['per_page'] == 30): ?> selected <?php endif; ?>>30</option>

                <?php for ($i = 50; $i < 550; $i = $i + 50): ?>
                                                                                                                                                                                                                                                                                    <option value="<?= $i ?>" <?php if ($_COOKIE['per_page'] == $i): ?> selected <?php elseif (!$_COOKIE['per_page'] && $i == 100): ?> selected <?php else: ?><?php endif; ?>> <?= $i ?></option>
<?php endfor; ?>
                                                                                                                                                                                                                                                                                            </select>

<?= $pages ?>

        </div>



    </div>

</div>
<div class="clear"></div> 